﻿<%@ Import Namespace="Wheels.Controllers" %>
<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Wheels.TransitService.StopObject>>" %>

<div id="BusStops" title="Stops" class="panel">
    <h2>
        Nearest Bus Stops</h2>
    <ul>
        <% foreach (var stop in Model)
           { %>
        <li>                    
        
<% if (Session[TransitController.EXEC_TYPE_KEY].ToString() == TransitController.EXEC_TYPE_FASTEST)
   { %>
   
   <a href="/Transit/BusStopAddRoute?stopId=<%=stop.StopID%>">

<% }
   else
   {
       if (Session[TransitController.EXEC_TYPE_KEY].ToString() == TransitController.EXEC_TYPE_NEXT)
       {%>
       
       <a href="/Transit/StopArrivals?stopId=<%=stop.StopID%>">

<% }
           else
           {
               if (Session[TransitController.EXEC_TYPE_KEY].ToString() == TransitController.EXEC_TYPE_WHERE)
               {%>
               
               <a href="/Transit/BusStop?stopId=<%=stop.StopID%>">
<% }
           }
       }%>    
        
       
            <%=stop.Name%>
            <div>
            <%foreach (var arr in stop.NearestArrivals)
              { %>            
                <%= arr.RouteName%><span class="routeDir"><%=(arr.Direction == 0 ? "S" : "N")%></span>
            <span class="redLabel">
                <%=arr.ArrivalTime.ToShortTimeString()%></span>
            <%
                } %>
                </div>
        </a></li>
        <% } %>
    </ul>
</div>
